﻿using System;
using System.Reflection;
using System.Windows.Forms;

namespace ShadowHelper
{
    static class Program
    {
        public static Form1 form1;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Load the referenced dll resource embedded in the exe file
            AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
            {
                String resourceName = Assembly.GetExecutingAssembly().GetName().Name + '.' + new AssemblyName(args.Name).Name + ".dll";
                using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
                {
                    Byte[] assemblyData = new Byte[stream.Length];
                    stream.Read(assemblyData, 0, assemblyData.Length);
                    return Assembly.Load(assemblyData);
                }
            };
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            form1 = new Form1();
            Application.Run(form1);
        }
    }
}
